package com.example.siyun.service.impl.userserverimp;

import com.example.siyun.mapper.usermapper.ApplyMapper;
import com.example.siyun.pojo.Apply;
import com.example.siyun.service.userserver.ApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

@Service
public class ApplyServerImp implements ApplyService {

    @Autowired
    private ApplyMapper applyMapper;

    /**
     * 审核列表全部查询
     * @param applyName
     * @param applyAccount
     * @param applyTime
     * @return
     */
    @Override
    @Transactional
    public List<Apply> getApp(String applyAccount, String applyName, String applyTime) {
        return applyMapper.getApp(applyAccount,applyName,applyTime);
    }

    /**
     * 条件查询(已批准，未审核，已驳回)
     * @param applyState
     * @param applyName
     * @param applyAccount
     * @return
     */
    @Override
    @Transactional
    public List<Apply> getAudit(String applyState,String applyName, String applyAccount) {
        return applyMapper.getAudit(applyState,applyName,applyAccount);
    }

    /**
     * 审核管理列表中未审核按钮
     * @param applyId
     * @param applyState
     * @return
     */
    @Override
    @Transactional
    public void update(String applyId, String applyState) {
        applyMapper.update(applyId,applyState);
    }
}
